#include "SeqList.h"
#include <malloc.h>
#include<assert.h>

typedef struct Student {
	char name[20];
	int age;
}Student;

Student* stu_new(int age, const char* name);

int main() {
	SeqList* list = seqList_new(5);

	for (int i = 0; i < 10; i++) {
		seqList_set(list, stu_new(i*2, "maye"));
	}
	for (int i = 0; i < list->size; i++) {
		//printf("%d ", seqList_get(list, i));
		Student* s = (Student*)seqList_get(list, i);
		printf("%d %s\n", s->age, s->name);
	}

	seqList_del(list);
	return 0;
}

Student* stu_new(int age, const char* name) {
	Student* stu = malloc(1, sizeof(Student));
	assert(stu != NULL);
	stu->age = age;
	strcpy(stu->name, name);
	return stu;
}